<%@page import="models.UserModel"%>
<%@page import="java.util.TreeMap"%>
<%@page import="java.net.URLEncoder"%>
<%@page import="helpers.DateHelper"%>
<%@page import="models.NewsModel"%>
<%@page import="java.util.ArrayList"%>
<%@page import="helpers.UrlHelper"%>
<%@page import="models.SiteConfigModel"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
TreeMap check = (TreeMap) request.getAttribute("check");
SiteConfigModel siteConfig = (SiteConfigModel) request.getAttribute("config");
String image = "";//UrlHelper.getServerUrl(request) + "/blobstore-serve?blob-key=" + siteConfig.getLogo();
String name = (String) request.getAttribute("name");
UserModel user = (UserModel) request.getAttribute("user");
String form = (String) request.getAttribute("form");
String success = (String) request.getAttribute("success");
%>

<jsp:include page="/layouts/header.jsp">
    <jsp:param name="title" value="<%=siteConfig.getTitle()%>" />
    <jsp:param name="description" value="<%=siteConfig.getMetaDescription()%>" />
    <jsp:param name="keywords" value="<%=siteConfig.getMetaKeywords()%>" />
    <jsp:param name="ogsite_name" value="<%=siteConfig.getSiteName()%>" />
    <jsp:param name="ogtitle" value="<%=siteConfig.getTitle()%>" />
    <jsp:param name="ogurl" value="<%=UrlHelper.getServerUrl(request)%>" />
    <jsp:param name="ogimage" value="<%=image %>" />
    <jsp:param name="ogdescription" value="<%=siteConfig.getMetaDescription()%>" />
</jsp:include>
<script type="text/javascript" src="/js/home.js"></script>
			<div class="block-content">
				<!-- STATIC PAGE -->
				<div class="column-block">
					<div class="block-column-2">
						<div class="static-block">
							<% if (success != null) { %>
							<div class="msg-s"><%=success %></div>
							<% } %>
							<div class="form-user">
								<h2><%=form.equalsIgnoreCase("edit") ? "Profile" : "Register" %></h2>
								<form action="" method="post">
								<table width="100%" cellpadding="0" cellspacing="0">
									<tbody>
										<tr>
											<td width="30%" class="username">Username</td>
											<td>
												<input type="text" name="username" value="<%=user.getUsername()%>" />
												<% if (check.get("username") != null) { %>
													<div class="error"><%=check.get("username")%></div>
												<% } %>
											</td>
										</tr>
										<tr>
											<td width="30%" class="password">Password</td>
											<td>
												<input type="password" name="password" value="<%=user.getPassword()%>" />
												<% if (check.get("password") != null) { %>
													<div class="error"><%=check.get("password")%></div>
												<% } %>
											</td>
										</tr>
										<tr>
											<td width="30%" class="password">RePassword</td>
											<td>
												<input type="password" name="repassword" value="<%=user.getRepassword()%>" />
												<% if (check.get("repassword") != null) { %>
													<div class="error"><%=check.get("repassword")%></div>
												<% } %>
											</td>
										</tr>
										<tr class="dotline">
											<td width="30%" class="name">Display Name</td>
											<td>
												<input type="text" name="name" value="<%=user.getName()%>" />
												<% if (check.get("name") != null) { %>
													<div class="error"><%=check.get("name")%></div>
												<% } %>
											</td>
										</tr>
										<tr>
											<td width="30%" class="gender">Gender</td>
											<td>
												Male <input type="radio" name="gender" value="0" checked="checked"/>
												FeMale <input type="radio" name="gender" value="1" />
												<% if (check.get("gender") != null) { %>
													<div class="error"><%=check.get("gender")%></div>
												<% } %>
											</td>
										</tr>
										<tr class="dotline">
											<td class="title">Captcha</td>
											<td>
												<% if (check.get("captcha") != null) { %>
													<div class="error"><%=check.get("captcha")%></div>
												<% } %>
												<script>
										        	var RecaptchaOptions = { theme : 'clean' };
										  		</script>
												<script type="text/javascript" src="http://api.recaptcha.net/challenge?k=6LeA0c4SAAAAAMsdjrB49GPol6XImTdJM2U2AHrF"></script>
											</td>
										</tr>
										<tr>
											<td></td>
											<td>
												<button type="submit"><%=!form.equalsIgnoreCase("add") ? "Update" : "Register" %></button>
											</td>
										</tr>
									</tbody>
								</table>
								</form>
							</div>
						</div>
					</div>
					<div class="block-column-1">
						<div class="sidebar-block">
							<div style="display: table-cell; height: 300px; width: 317px; text-align: center; vertical-align: middle;">
								<h1>Adv</h1>
							</div>
						</div>
					</div>
					<div class="clear"></div>
				</div>
				<!-- END STATIC PAGE -->
			</div>

<jsp:include page="/layouts/footer.jsp">
    <jsp:param name="language" value="1" />
</jsp:include>	